﻿@model Dictionary<int, List<Wicresoft.SelfService.DAO.BreakConfig>>
@using Wicresoft.SelfService.DAO

@{
    ViewBag.Title = "故障维护";
    Layout = "~/Views/Shared/_BreakConfigLayout.cshtml";
}

<style type="text/css">
    a.LogOut:hover{ color:#FFFFFF;}
    a.LogOut{ color:#87CEFA;}
</style>

<script type="text/javascript">
    $(document).ready(function(){
        var url="@Url.Action("CreateBreak","BDMaintain")";
        $("#rightpart").load(url);
    });
    function getBreakDetailInfo(id) {
        var currentID = id;
        var url="@Url.Action("ShowBreakDetail", "BDMaintain")";
        url += "?ID="+currentID;
        $("#rightpart").load(url);
    }

    function getCreatePage(){
        var url="@Url.Action("CreateBreak","BDMaintain")";
        $("#rightpart").load(url);
    }
</script>

<div class="center">
    <div class="box">

        <div class="main_left">
            <div class="headpart ui-icons">
            </div>
            <div class="left_menu">
                    
                <div class="left_menu_border">
                    <a href="#" id="createUrl" onclick="getCreatePage();">
                        <input type="button" id="CrtBD" value="创建故障分类" style=" height:30px; width:193px; font-weight:bold;" />
                    </a>
                </div>
                <hr />
                @{int i = 1;}
                @foreach (KeyValuePair<int, List<BreakConfig>> kvp in Model)
                {
                    int key = kvp.Key;
                    List<BreakConfig> breaks = kvp.Value;
                    BreakConfig firstBreak = breaks[0];

                    var vid = "VNavParent" + i;
                    i++;
                    <div class="left_menu_border">
                        <div class="ui-icons VNavParentI" id="@vid" onclick="VNavParent(this);">
                            &nbsp;&nbsp;&nbsp;&nbsp; @firstBreak.LvlName
                            <ul style="display: none;" id="SD">
                                @for (int j = 1; j < breaks.Count; j++)
                                {
                                    BreakConfig b = breaks[j];
                                    <li class="VNavLeaf">
                                        <a href="#" class="ui-icons" id="@b.ID" onclick="getBreakDetailInfo(@b.ID);getVNavLeaf(@i,this);" >
                                            @if (b.LvlName.Length < 10)
                                            {
                                                <span title="@b.LvlName">@b.LvlName</span>
                                            }
                                            else
                                            {
                                                var name1 = b.LvlName.Substring(0, 10).ToString() + "...";
                                                <span title="@b.LvlName">@name1</span>
                                            }
                                        </a>
                                    </li>
                                }
                            </ul>
                        </div>
                    </div>
                }
                        
            </div>
        </div>
        <div class="main_right" id="rightpart" data-url="">
              
        </div>
    </div>
</div>
